const TabbarListMap = [
  {
    text: '首页',
    pagePath: '/pages/index/main',
    iconPath: '/static/tabs/tab-home.png',
    selectedIconPath: '/static/tabs/tab-home-active.png',
  },
  {
    text: '报告',
    pagePath: '/pages/report/main',
    iconPath: '/static/tabs/tab-report.png',
    selectedIconPath: '/static/tabs/tab-report-active.png',
  },
  {
    text: '我的',
    pagePath: '/pages/mine/main',
    iconPath: '/static/tabs/tab-mine.png',
    selectedIconPath: '/static/tabs/tab-mine-active.png',
  },
];

Component({
  data: {
    visible: true,
    selectedPath: '',
    color: '#7A7E83',
    selectedColor: '#2361ff',
    tabbarList: [...TabbarListMap],
  },
  methods: {
    hide() {
      this.setData({
        visible: false,
      });
    },
    show() {
      this.setData({
        visible: true,
      });
    },
    switchTab(e) {
      const data = e.currentTarget.dataset;
      const url = data.path;
      wx.switchTab({ url });
    },
    setSelected(path = '') {
      console.log(path, 123123123)
      this.setData({
        selectedPath: path,
      });
    },
  },
});
